import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/welcome/Login'
import WorkOrder from '@/workOrder/WorkOrder'
import WorkOrderList from '@/workOrder/List'
import WorkOrderSave from '@/workOrder/Save'
import AcceptList from '@/workOrder/AcceptList'
import AcceptSave from '@/workOrder/AcceptSave'
import SpareParts from '@/spareParts/SpareParts'
import SparePartsList from '@/spareParts/List'
import SparePartsSave from '@/spareParts/Save'

Vue.use(Router);

export default new Router({
  routes: [
    {
      path: '',
      component: Login
    },
    {
      path: '/login',
      name: 'login',
      component: Login
    },
    {//工单模块路由
      path: '/workOrder',
      name: 'workOrder',
      component: WorkOrder,
      children: [
        // {
        //   path: '/',
        //   component: WorkOrderList
        // },
        {//工单列表
          path: 'list',
          name: 'workOrderList',
          component: WorkOrderList
        },
        {//工单新建
          path: 'save',
          name: 'workOrderList.save',
          component: WorkOrderSave
        },
        {//报修受理列表
          path: 'acceptList',
          name: 'workOrderAccept',
          component: AcceptList
        },
        {//报修受理新建
          path: 'acceptSave',
          name: 'workOrderAccept.save',
          component: AcceptSave
        },
      ]
    },
    {//零件模块路由
      path: '/spareParts',
      name: 'spareParts',
      component: SpareParts,
      children: [
        // {
        //   path: '/',
        //   component: SparePartsList
        // },
        {
          path: 'list',
          name: 'sparePartsList',
          component: SparePartsList
        },
        {
          path: 'save',
          name: 'sparePartsSave',
          component: SparePartsSave
        },
      ]
    }
  ]
})
